#include "User.h"
#include<Windows.h>
User::User(string U_N,string P_W,int D_W_N, int D_C, int A_C) {
	UserName = U_N;
	PassWord = P_W;

	SYSTEMTIME sys;
	GetLocalTime(&sys);
	Tag = sys.wDay;
	Time[0] = sys.wMonth;
	Time[1] = sys.wDay;

	DayWantNumber = D_W_N;
	DayCount = D_C;
	AllCount = A_C;
	Registed = true;
}
void User::changeUserName(string U_N) {
	UserName = U_N;
}
void User::changePassWord(string P_W) {
	PassWord = P_W;
}
void User::changeDayWantNumber(int D_W_N) {
	DayWantNumber = D_W_N;
}
void User::changeDayCount(int D_C) {
	SYSTEMTIME sys;
	GetLocalTime(&sys);
	if (Tag == sys.wDay) {
		DayCount += D_C;
	}
	else {
		DayCount = D_C;
		Tag = sys.wDay;
	}
	
}
void User::changeAllCount(int A_C) {
	AllCount += A_C;
}
string User::getUserName() {
	return UserName;
}
string User::getPassWord() {
	return PassWord;
}
int User::getDayWantNumber() {
	return DayWantNumber;
}
int User::getDayCount() {
	return DayCount;
}
int User::getAllCount() {
	return AllCount;
}
bool User::getRegisted() {
	return Registed;
}